package com.sphd.education.activitys;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.nostra13.universalimageloader.core.ImageLoader;
import com.sphd.education.R;
import com.sphd.education.info.SchoolImgInfo;
import com.sphd.education.modle.EducationUrl;

import butterknife.Bind;
import butterknife.ButterKnife;
/*
* 学校详细介绍
*
* */
public class SchoolIntroduceActivity extends AppCompatActivity {

    @Bind(R.id.toolbar)
    Toolbar toolbar;
    @Bind(R.id.image_school)
    ImageView imageSchool;
    @Bind(R.id.image_name)
    TextView imageName;
    @Bind(R.id.image_introduce)
    TextView imageIntroduce;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_school_introduce);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {
        toolbar.setTitle("教学环境");
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();//这是自带的箭头的返回的监听
            }
        });
        Intent intent=getIntent();
        SchoolImgInfo schoolImgInfo = (SchoolImgInfo) intent.getSerializableExtra("schoolImgInfo");
        ImageLoader.getInstance().displayImage(EducationUrl.HttpTitle + "/" + schoolImgInfo.getSchool_img_url(), imageSchool);
        imageName.setText("\t" + schoolImgInfo.getImg_name());
        imageIntroduce.setText("\t\t"+schoolImgInfo.getIntroduce());

    }

}
